package com.example.android.ui.activity

import android.annotation.SuppressLint
import android.os.Bundle
import androidx.navigation.findNavController
import androidx.navigation.ui.setupWithNavController
import com.example.android.R
import com.example.android.databinding.ActivityMainBinding
import com.example.android.ui.dialog.MessageDialog
import com.example.android.ui.dialog.VoiceDialog
import com.example.android.ui.home.HomeViewModel
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.zxf.basic.base.BindingActivity
import com.zxf.basic.expand.viewModel
import dagger.hilt.android.AndroidEntryPoint

@SuppressLint("ClickableViewAccessibility")
@AndroidEntryPoint
class MainActivity : BindingActivity<ActivityMainBinding>(ActivityMainBinding::inflate) {

    private val vm : HomeViewModel by lazy {
        viewModel()
    }
    private val messageDialog by lazy {
        MessageDialog(this) {

        }
    }
    private val voiceDialog by lazy {
        VoiceDialog(this) {

        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val navView: BottomNavigationView = binding.navView

        val navController = findNavController(R.id.nav_host_fragment_activity_main)

        navView.setupWithNavController(navController)

        messageDialog.show()
        messageDialog.setOnDismissListener {
            voiceDialog.show()
        }
//        navView.setOnItemSelectedListener { item ->
//            when (item.itemId) {
//                R.id.navigation_home -> {
//                    item.icon.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_ATOP)
//                }
//                R.id.navigation_system -> {
//
//                }
//                R.id.navigation_mine -> {
//
//                }
//            }
//            return@setOnItemSelectedListener true
//        }
    }

    override fun initView() {

    }

    override fun initData() {

    }
}